<template>
    <div class="container">
        <div></div>

        <div class="table">
            <el-table :data="tableData" border style="margin-left: 25px; width: 98%" @row-click="handleRowClick">
                <el-table-column prop="a" label="序号" width="70" align="center">
                </el-table-column>
                <el-table-column prop="b" label="确认产品名称/确认产品型号" width="350" align="center">
                </el-table-column>
                <el-table-column prop="c" label="产品编号" align="center">
                </el-table-column>
                <el-table-column prop="d" label="安标编号" align="center">
                </el-table-column>
                <el-table-column prop="e" label="安标类型" align="center">
                </el-table-column>
                <el-table-column prop="f" label="发证日期" align="center">
                </el-table-column>
                <el-table-column prop="g" label="起始日期" align="center">
                </el-table-column>
                <el-table-column prop="h" label="截止日期" align="center">
                </el-table-column>
                <el-table-column prop="i" label="下载次数" align="center">
                </el-table-column>
                <el-table-column label="验证报告下载" prop="j" align="center">
                    <template slot-scope="scope">
                        <el-link :href="scope.row.j" target="_blank">下载</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="k" label="安标状态" align="center">
                </el-table-column>
            </el-table>
        </div>

    </div>
</template>

<script>
import { pdf } from "../https/api/user";
export default {
    name: '',
    data() {
        return {
            tableData: [
                {
                    a: '1',
                    b: '煤矿自然发火束管监测系统KJ1450',
                    c: '37669620220002',
                    d: 'MFC220114',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2022-09-20',
                    h: '2027-09-19',
                    i: '1',
                    j: 'http://120.192.101.205:9090/group1/default/20240810/15/39/8/煤矿自然发火束管监测系统检验报告.pdf?name=%E7%85%A4%E7%9F%BF%E8%87%AA%E7%84%B6%E5%8F%91%E7%81%AB%E6%9D%9F%E7%AE%A1%E7%9B%91%E6%B5%8B%E7%B3%BB%E7%BB%9F%E6%A3%80%E9%AA%8C%E6%8A%A5%E5%91%8A.pdf&download=1',
                    k: '正常',

                },

                {
                    a: '2',
                    b: '矿用本安型激光多种气体分析仪YHQ6',
                    c: '37669620220004',
                    d: 'MFD220647',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2022-09-20',
                    h: '2027-09-19',
                    i: '2',
                    j: 'http://120.192.101.205:9090/group1/default/20240810/15/33/8/矿用本安型激光多种气体分析仪检验报告.pdf?name=%E7%9F%BF%E7%94%A8%E6%9C%AC%E5%AE%89%E5%9E%8B%E6%BF%80%E5%85%89%E5%A4%9A%E7%A7%8D%E6%B0%94%E4%BD%93%E5%88%86%E6%9E%90%E4%BB%AA%E6%A3%80%E9%AA%8C%E6%8A%A5%E5%91%8A.pdf&download=1',
                    k: '正常',

                }
                ,
                {
                    a: '3',
                    b: '矿用隔爆兼本安型直流稳压电源KDW660/18B',
                    c: '37669620220012',
                    d: 'MAA230154',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2023-06-13',
                    h: '2028-06-12',
                    i: '4',
                    j: '下载',
                    k: '正常',

                }
                ,
                {
                    a: '4',
                    b: '矿用光纤测温及灭火控制系统KJ1583',
                    c: '37669620220011',
                    d: 'MFC230105',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2023-07-05',
                    h: '2028-07-04',
                    i: '1',
                    j: '下载',
                    k: '正常',

                }
                ,
                {
                    a: '5',
                    b: '矿用本安型束管监测气体预处理控制箱KJ1450-X',
                    c: '37669620220001',
                    d: 'MFE220666',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2022-09-20',
                    h: '2027-09-19',
                    i: '1',
                    j: '下载',
                    k: '正常',

                },
                {
                    a: '6',
                    b: '矿用本安型交换机KJJ18',
                    c: '37669620220003',
                    d: 'MFD220422',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2022-07-02',
                    h: '2027-07-01',
                    i: '2',
                    j: '下载',
                    k: '正常',

                },
                {
                    a: '7',
                    b: '矿用本安型电动球阀DFH-20/7',
                    c: '37669620210001',
                    d: 'MEE220587',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2022-07-02',
                    h: '2027-09-19',
                    i: '1',
                    j: '下载',
                    k: '正常',

                },
                {
                    a: '8',
                    b: '矿用光纤锚杆(索)应力传感器GMYG600',
                    c: '20192310002',
                    d: 'MFB190273',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2019-08-07',
                    h: '2024-08-06',
                    i: '2',
                    j: '下载',
                    k: '正常',

                }
                ,
                {
                    a: '9',
                    b: '矿用隔爆兼本安型光纤顶板动态监测主机KJ1068-Z',
                    c: '20186438004',
                    d: 'MHC190052',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2019-08-07',
                    h: '2024-08-06',
                    i: '1',
                    j: '下载',
                    k: '正常',

                }
                ,
                {
                    a: '10',
                    b: '矿用光纤顶板离层传感器GLCG500',
                    c: '20192310001',
                    d: 'MFB190275',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2019-08-07',
                    h: '2024-08-06',
                    i: '1',
                    j: '下载',
                    k: '正常',

                }
                ,
                {
                    a: '11',
                    b: '矿用分布式光纤测温系统KJ1067',
                    c: '20186438001',
                    d: 'MFC190050',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2019-05-15',
                    h: '2024-05-15',
                    i: '2',
                    j: '下载',
                    k: '正常',

                }
                ,
                {
                    a: '12',
                    b: '矿用光纤钻孔应力传感器GZYG40',
                    c: '20192310003',
                    d: 'MFB190274',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2019-08-07',
                    h: '2024-08-06',
                    i: '2',
                    j: '下载',
                    k: '正常',

                }
                ,
                {
                    a: '13',
                    b: '矿用光纤顶板动态监测系统KJ1068',
                    c: '20186438003',
                    d: 'MFC190086',
                    e: 'MA',
                    f: '2024-03-04',
                    g: '2019-08-07',
                    h: '2024-08-06',
                    i: '3',
                    j: '下载',
                    k: '正常',

                }

            ]
        }
    },
    mounted() {
        this.Onlist()
    },
    methods: {
        handleRowClick() {
            console.log(111);
        },
        Onlist() {
            pdf().then(res => {
                console.log(res);
            })
        },
        handleDown(val) {
            const a = document.createElement("a");
            const event = new MouseEvent("click");
            a.download = val.attachmentName;
            a.href = 下载文件的基本url + val.documentId;
            a.dispatchEvent(event);
        },
    },
}
</script>
<style lang="less" scoped>
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.container {
    width: 100vw;

    >div:nth-child(1) {
        width: 100%;
        height: 70px;
        border-bottom: 3px solid rgb(0, 132, 202);
        background-image: url('../assets/table.png');
    }

    >div:nth-child(2) {
        width: 100%;
        height: 750px;
    }

}
</style>
